package com.changhongit.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.changhongit.dao.ServiceProjectDao;
import com.changhongit.entity.ServiceProject;
import com.changhongit.service.ServiceProjectService;
import com.changhongit.util.PageView;

@Transactional
@Service("serviceProjectService")
public class ServiceProjectServiceImpl implements ServiceProjectService {
	@Autowired
	private ServiceProjectDao serviceProjectDao;

	public PageView query(PageView pageView, ServiceProject serviceProject) {
		List<ServiceProject> list = serviceProjectDao.query(pageView, serviceProject);
		pageView.setRecords(list);
		return pageView;
	}

	public void add(ServiceProject serviceProject) {
		serviceProjectDao.add(serviceProject);

	}

	public void delete(String id) {
		serviceProjectDao.delete(id);

	}

	public ServiceProject getById(String id) {
		return serviceProjectDao.getById(id);
	}

	public void modify(ServiceProject serviceProject) {
		serviceProjectDao.modify(serviceProject);
	}

	@Override
	public List<ServiceProject> findAllByServiceId(int id) {
		return serviceProjectDao.findAllByServiceId(id);
	}

}
